/******************************************************
* drv_l2_touch_panel.h
*
* Purpose: Touch Panel l2 driver
*
* Author: Eugene Hsu
*
* Date: 2017/03/27
*
* Copyright Generalplus Corp. ALL RIGHTS RESERVED.
*
* Version : 
* History :
*
*******************************************************/
#ifndef __DRV_L2_TOUCH_PANEL_H__
#define __DRV_L2_TOUCH_PANEL_H__
#include "driver_l1.h"

typedef struct TOUCH_PANEL_KEY_INFO_S
{
	INT32S id;
	INT32S x_axis;
	INT32S y_axis;
	INT32S w_axis;
	INT32S istouch;
} TOUCH_PANEL_KEY_INFO_S;

typedef struct TOUCH_PANEL_OPERATION_TBL_S
{
	void (*touch_panel_init)(void*);
	void (*touch_panel_uninit)(void);
	void (*touch_panel_process_event)(TOUCH_PANEL_KEY_INFO_S*);
	
} TOUCH_PANEL_OPERATION_TBL_T;

typedef void(*TOUCH_PANEL_EXTINT_CBK)(void);
typedef void(*TOUCH_PANEL_AP_CBK)(TOUCH_PANEL_KEY_INFO_S *key_info);

#if (_OPERATING_SYSTEM == _OS_UCOS2)
#define TOUCH_PANEL_10MS_DELAY(x)	OSTimeDly(x)
#else
#define TOUCH_PANEL_10MS_DELAY(x)
#endif

extern void drv_l2_tp_register_operation_table(TOUCH_PANEL_OPERATION_TBL_T *op_tbl);
extern void drv_l2_touch_panel_init(void* cbk);
extern void drv_l2_touch_panel_uninit(void);
extern void drv_l2_touch_panel_process_event(TOUCH_PANEL_KEY_INFO_S *key_info);

#endif //__DRV_L2_TOUCH_PANEL_H__
